package net.lovesrc.allin.jobs;

import com.alibaba.fastjson.JSONObject;
import net.lovesrc.allin.biz.gogohome.GogoHomeLoginSign;
import net.lovesrc.allin.biz.gogohome.HomeAccountQueue;
import net.lovesrc.allin.jobs.base.BaseJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@Component
@Profile("2021")
public class GogoHomeSignJob extends BaseJob {

    @Autowired
    GogoHomeLoginSign gogoHomeLoginSign;

    @Override
    public void runOnce() throws Exception {
        try {
            JSONObject take = HomeAccountQueue.queue.take();
            gogoHomeLoginSign.sign(take);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
